home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 4.1 KB | 165 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWContxt.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWCONTXT_H
- #define FWCONTXT_H
-
- // ----- Graphic Includes -----
-
- #ifndef FWGC_H
- #include "FWGC.h"
- #endif
-
- #ifndef SLGDEV_H
- #include "SLGDev.h"
- #endif
-
- #ifndef FWGRUTIL_H
- #include "FWGrUtil.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class ODFacet;
- class ODShape;
- class ODWindow;
-
- class FW_CView;
-
- //========================================================================================
- // class FW_CWindowContext
- //========================================================================================
-
- class FW_CWindowContext : public FW_CGraphicContext
- {
- public:
-
- FW_DECLARE_AUTO(FW_CWindowContext)
-
- FW_CWindowContext(Environment* ev, ODWindow *odWindow);
- FW_CWindowContext(Environment* ev, ODFacet *odFacet);
- virtual ~ FW_CWindowContext();
-
- virtual void Reset();
-
- protected:
- void InitWindowContext(Environment* ev, ODWindow *odWindow);
-
- ODShape* AcquireClipShape(Environment* ev);
-
- private:
- ODWindow* fODWindow;
- FW_HGDevice fTempDevice; // We need a temporary device in the case where the root
- // facet is not one of ours
- };
-
- //========================================================================================
- // class FW_CFrameContext
- //========================================================================================
- // The frame context is used for example by the FW_CViewAs to draw the icon or thumbnail
- // in frame coordinates
-
- class FW_CFrameContext : public FW_CGraphicContext
- {
- public:
-
- FW_DECLARE_AUTO(FW_CFrameContext)
-
- FW_CFrameContext(Environment* ev, ODFacet *facet, ODShape* invalidShape = NULL);
- virtual ~ FW_CFrameContext();
-
- virtual void Reset();
-
- ODFacet* GetFacet() const
- {return fFacet;}
- private:
- ODFacet* fFacet;
- };
-
- //========================================================================================
- // class FW_CPlatformGraphicContext
- //========================================================================================
-
- class FW_CPlatformGraphicContext : public FW_CGraphicContext
- {
- public:
-
- FW_DECLARE_AUTO(FW_CPlatformGraphicContext)
-
- FW_CPlatformGraphicContext(Environment* ev, ODFacet *facet, ODShape* invalidShape = NULL);
- virtual ~ FW_CPlatformGraphicContext();
-
- virtual void Reset();
-
- ODFacet* GetFacet() const
- {return fFacet;}
-
- protected:
- #ifdef FW_BUILD_MAC
- void PrivMacAlignOrigin(Environment* ev);
- #endif
-
- private:
- ODFacet* fFacet;
- #ifdef FW_BUILD_MAC
- GrafPtr fMacPort;
- Point fMacOrigin;
- #endif
- };
-
- //========================================================================================
- // class FW_CViewContext
- //========================================================================================
-
- class FW_CViewContext : public FW_CGraphicContext
- {
- // ----- Initialization/destruction
- public:
-
- FW_DECLARE_AUTO(FW_CViewContext)
-
- FW_CViewContext(Environment* ev, FW_CView* view, ODFacet* facet, ODShape* invalidShape = NULL);
- virtual ~FW_CViewContext();
-
- void Reset();
-
- FW_CView* GetView() const;
- ODFacet* GetFacet() const;
-
- protected:
- ODTransform* PrivAcquireTransform(Environment* ev);
- ODShape* PrivAcquireClipShape(Environment* ev);
-
- private:
- FW_CView* fView;
- ODFacet* fFacet;
- };
-
- //----------------------------------------------------------------------------------------
- // FW_CViewContext::GetView
- //----------------------------------------------------------------------------------------
-
- inline FW_CView* FW_CViewContext::GetView() const
- {
- return fView;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CViewContext::GetFacet
- //----------------------------------------------------------------------------------------
-
- inline ODFacet* FW_CViewContext::GetFacet() const
- {
- return fFacet;
- }
-
- #endif
-